home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / dictionaries-common.postinst < prev    next >
Text File  |  2009-05-15  |  4KB  |  98 lines

  1. #! /bin/sh
  2. # postinst script for dictionaries-common
  3.  
  4. set -e
  5.  
  6. # Sourcing debconf confmodule
  7. . /usr/share/debconf/confmodule
  8.  
  9. case "$1" in
  10.   configure)
  11.   # This will remove /usr/share/pspell/region-to-spelling.map diversion by
  12.   # dictionaries-common package and associated stuff if present
  13.     rm -f /var/cache/dictionaries-common/region-to-spelling.map
  14.  
  15.   # This next handles a bug in some dpkg versions not removing
  16.   # the symlink properly when upgrading
  17.     if [ -L /usr/share/pspell/region-to-spelling.map ]; then
  18.     RTS_DEST=`readlink /usr/share/pspell/region-to-spelling.map`
  19.     if [ "$RTS_DEST" = "/var/cache/dictionaries-common/region-to-spelling.map" ]; then
  20.         rm -f /usr/share/pspell/region-to-spelling.map
  21.     fi
  22.     fi
  23.  
  24.   # Removing the diversion if it still exists. trued just in case it does not,
  25.   # since grep returns error breaking postinst because of set -e otherwise.
  26.     DC_DIVERT=`dpkg-divert --list dictionaries-common | grep region-to-spelling.map` || true
  27.     if [ "$DC_DIVERT" ]; then
  28.     dpkg-divert --package  dictionaries-common --remove --rename \
  29.         --divert /usr/share/pspell/region-to-spelling.map.orig \
  30.         /usr/share/pspell/region-to-spelling.map
  31.     fi
  32.  
  33.     # We no longer create the /usr/dict symlink
  34.  
  35.     # This will check for obsolete /etc/dictionary link
  36.     if [ -L /etc/dictionary ]; then
  37.     db_get dictionaries-common/old_wordlist_link
  38.     if [ "$RET" = "true" ]; then
  39.         rm /etc/dictionary
  40.     fi
  41.     fi
  42.  
  43.     # Ensure that automatic generation of files is done, such that we always
  44.     # start with a sane environment
  45.     update-default-ispell     --rebuild
  46.     update-default-wordlist   --rebuild
  47.     update-dictcommon-aspell
  48.     update-dictcommon-hunspell
  49.     update-openoffice-dicts
  50.  
  51.     # Remove obsolete jed startup file
  52.     if [ -f /etc/jed-init.d/50dictionaries-common.sl ] ; then
  53.         echo "Removing obsolete /etc/jed-init.d/50dictionaries-common.sl" >&2
  54.         rm -f /etc/jed-init.d/50dictionaries-common.sl
  55.     fi
  56.  
  57.     # That made this dir not be removed by dpkg. Remove it if exists, is non
  58.     # empty, and jed-common is not installed
  59.     if [ -d /etc/jed-init.d ] && [ ! -e /etc/jed-init.d/00debian.sl ]; then
  60.         rmdir --ignore-fail-on-non-empty /etc/jed-init.d
  61.     fi
  62.  
  63.     # ---------------- 8< ----------------------------------------------------
  64.     # Remove obsolete dictionaries-common.reconfiguring. This problem only
  65.     # lasted for two days and, so this should go away long before releasing lenny
  66.     if [ -f /var/cache/dictionaries-common/postinst.reconfiguring ] ; then
  67.         echo "Removing obsolete /var/cache/dictionaries-common/postinst.reconfiguring" >&2
  68.         rm -f /var/cache/dictionaries-common/postinst.reconfiguring
  69.     fi
  70.     # ---------------- 8< ----------------------------------------------------
  71.  
  72.     # Remove obsolete aspell-equivs file
  73.     if [ -f /var/cache/dictionaries-common/emacsen-aspell-equivs.el ] ; then
  74.         echo "Removing obsolete /var/cache/dictionaries-common/emacsen-aspell-equivs.el" >&2
  75.         rm -f /var/cache/dictionaries-common/emacsen-aspell-equivs.el
  76.     fi
  77.  
  78.   ;;
  79.  
  80.   abort-upgrade|abort-remove|abort-deconfigure)
  81.   ;;
  82.  
  83.   *)
  84.     echo "postinst called with unknown argument \`$1'" >&2
  85.     exit 0
  86.   ;;
  87. esac
  88.  
  89. # We need to test that there are emacsen installed before calling emacs-package-*
  90. if [ "$1" = "configure" ] && [ -x /usr/lib/emacsen-common/emacs-package-install ]
  91. then
  92.     [ -e /var/lib/emacsen-common/installed-flavors ] && /usr/lib/emacsen-common/emacs-package-install dictionaries-common
  93. fi
  94.  
  95.  
  96.  
  97. exit 0
  98.